﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TVNNewDBLayer.DAL;

namespace TVNNewDBLayer.BLL
{
    public class CategoryBLL
    {
        CategoryDAL categoryDAL;
        public CategoryBLL()
        {
            categoryDAL = new CategoryDAL();
        }

        public List<TB_Category> GetCategories() {
            List<TB_Category> categories = categoryDAL.GetAll().Where(a=>a.ParentID == (int?)null && a.Visible == true).OrderBy(a=>a.Rank).ToList();
            return categories;
        }

    }
}
